On Dec 10, 2007, at 11:31 PM, Daniel Gollas wrote:

>> imm wrote:
>>> Edit your copy of Fl_Menu_add.cxx, and around line 124, add the
>>> following code. Note: this is just a suggestion, I haven't actually
>>> tried this, there's no win32 box here right now. The intent seems
>>> simple enough, so I'm sure you can make it work as intended.
>>>
>>> #ifdef WIN32
>>>     // leading "D:" makes us assume it is a filename:
>>>     if (mytext[1] == ':') {
>>>       if(isalpha((mytext[0])){
>>>         item = mytext;
>>>         break;
>>>       }
>>>     }
>>> #endif
>>>
>>>
>>> That should stop the menu->add() method breaking up your path names
>>> as menu tree's, giving the behaviour you want.
>>
>>      Mmm, that'll work for drive letter paths, but not UNCs,
>>      eg. "//yourserver/volname/path", which you can end up with
>>      if you browse to a server thru Network Neighborhood, or have
>>      to use due to the limitations of drive letters in multiuser
>>      contexts.
>>
>>      I guess you could also check for a leading / or //
>
> Thanks all for the replies, I guess it's a common problem.


What's wrong with using this version of "add()":

int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void  
*user_data=0, int flags=0)

It will not do any path expansion at all and not use any control  
characters. No pre text-filtering required. You do need to create the  
menu items in order though becuase this call has no positional argument.

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to