![]() |
|
#1
|
|||
|
|||
Menu size using FLUIDHello all,
I'm just starting with FLTK, been doing C++ for a couple years now, but I'm no expert. I'm trying out FLUID and I seem to have a problem. I've made a normal window, size 915px by 589px, then added a menu bar with the submenu "File". I want the window resizable, but not the menu bar, so I ticked the appropriate boxes in the GUI tabs of the properties windows of the window itself and the menu bar. I wanted the menu bar 20px tall, always. The problem occurs when I compile the program and test it. In the window I have made, everything looks perfect, except when I resize the window. If I make it smaller, the menu bar gets thinner, like down to what looks like 5px or so. When I make the window full sized, the menu bar is like 40px tall. The text of the "File" submenu stays the same size, but recenters itself in the new menu bar size. I played around with it, and when I check the box for the menu bar to be resizable, it can go from 5px to like 100px when the window resized... so I am aware of the difference it makes. I am using the Quincy 2005 IDE to compile everything, and it works great! It has examples included with the IDE, so I ran one for a simple text editor. The menu bar on that program stays the same size all the time. Comparing at the code, that program seems to have less "stuff" involved in the submenus. Am I missing something, or is this just a problem I have to live with? Thanx, Adam |
|
#2
|
||||
|
||||
Re: menu size using FLUIDHello and Welcome Adam.
Are you using 1.1.x or 2.0? I know I have an example for 1.1 around here somewhere. I'll see if I can't find it for you. The trick is to constrain your resizing using an invisible box. I'll post something this evening when I get a chance. Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#3
|
|||
|
|||
Re: menu size using FLUIDHello,
I'm using FLUID version 1.1.7 thanx, Adam |
|
#4
|
|||
|
|||
Re: menu size using FLUIDDo *not* click resizable on the window. Instead click resizable on one of the widgets in the window (directly below the window in the widget tree).
A tutorial: Make a window and a menu bar (with a File entry), as usual. Make a button in the centre of the window, and check Resizable for the button. Run it. You should see that the window is resizable, and the button resizes according to the window size. |
|
#5
|
||||
|
||||
Re: menu size using FLUIDI knew there was an example around here somewhere.
The last reply in this thread has a fluid file with an example of what I'm talking about. The menubar will resize horizontally but not vertically. Some of the image button bins won't resize at all while others will. Take a look to see if it helps with your understanding of resizing and constraining resizing. Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#6
|
||||
|
||||
Re: menu size using FLUIDSame example, stripped down a bit...
compiled with: g++ -Wall menu_size2.cxx `fltk-config --cxxflags --ldflags --use-images` -s -o MenuSize menu_size2.fld Code:
Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#7
|
|||
|
|||
Re: menu size using FLUIDThank you for all your help. I'm still learning a lot about FLUID. I really like it a lot! I'd been afraid of GUI designing because i didn't understand classes that much, but i am slowly learning (mostly by trial and error...) So far in my program, the menu bar is acting the same, however, it isn't very noticeable, unless you make the windows insanely small, and only slightly noticeable if the window is maximized.
I think its just my inexperience so far that's holding me back, I'm planning on leaving a few problems that i can't figure out yet until I port the rest of my program (originally written using BGI with the CS1300 package... search google for that one... It was for some college's class or something.) At the moment, I am trying to figure out how to get the thing to open a text file with a series of points in it, and draw those points on the window. I've written a program that can draw it, and i've written a program that can let me select a file (won't actually open it tho...) so i'll be meshing these two together for a bit. Thanks again for all your help. Once I learn more about it tho, i will be sure to learn from your example! Adam |
|
#8
|
||||
|
||||
Re: menu size using FLUIDDon't hesitate to post any code to get input about. It is preferred if you post a working example that shows your problem. That way others might compile it and give some feedback. When posting code, please use [cpp] your code [/cpp] for regular code or just [code] your code [/code] for fluid files/output messages.
Using Fl_File_Browser or Fl_File_Chooser should get you going. As for my example, its really not that complex. There are boxes that control the resizing behavior named either just "Box" or some name _resize. Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#9
|
|||
|
|||
Re: menu size using FLUIDOk, here's a stripped down version of my code. basically i want a nice GUI, then when you go to File=> open, and open a file, it takes points from the file (format shown below) and draws those points. The code below won't run right, again, its just a stripped down version.
Format for "input.plot" input file Format: NL = "new line" start a new line OL = "old line" just move from the previous point to the next point example: NL x,y; OL x2,y2; Code:
CPP / C++ / C Code:
Ok, that's all I got. When I get to the point that i assume its importing the file, i get an error and the program has to close. Using just the drawing algorithm, I've gotten it to work, but adding the open file thing is giving me problems. Even when I make it automatically load a file so you don't select the file to open with file=> open, (just to skip the file selection process) it gives me the error. Any help would be appreciated. Thanx, Adam |
|
#10
|
|||
|
|||
Re: menu size using FLUIDi look your code quickly
CPP / C++ / C Code:
extending a new widget within the callback ? read this documentation http://www.fltk.org/documentation.ph...ml#subclassing look this codes http://www.geocities.com/rferdiez/en/fltk/#fl_canvas http://www.kiwacan.co.nz/fltk/Fl_PlotXY.html |
Recent GIDBlog
Toyota - 2008 August Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FLTK && fluid In Motion | cable_guy_67 | FLTK Forum | 4 | 20-Mar-2008 03:52 |
| Need Help With Recursive Functions | jonas12rena | C Programming Language | 1 | 31-Jul-2006 11:12 |
| Shapes Functions Version 2 - Arrays! | Cecil | C Programming Language | 1 | 09-Jul-2006 20:39 |
| GIMcontacts - a gim fltk fluid venture | cable_guy_67 | FLTK Forum | 0 | 14-Feb-2005 14:18 |
| Having a problem | Chuckles | Computer Hardware Forum | 19 | 13-Sep-2004 12:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The